#include "MultiArray.h"

#define UNIFORM_KNOT 1

class PP
{
public:
	PP(void);
	~PP(void);


#if	UNIFORM_KNOT	
#else
	MultiArr<double>* knot;
#endif

	void SolveEquations(int* RootNum, float* RootXYZ);
	void SolveEquationsIter(double Interval[3][2], MultiArr<double>* Coeff, int* RootNum, float* RootXYZ);
	void SolveEquationsNoIter(double Interval[3][2], MultiArr<double>* Coeff, int* RootNum, float* RootXYZ);

	void SetEquationCoeff(int nEqua, int* nDeg, int maxDeg[3], double* weight);

	void GetProjectedIntevalIntersection(MultiArr<double>* Coeff, double Interval[3][2], double AxisInterval[3][2]);
	bool AxisIntersection(double* convex, double intersect[2], int deg);

	void ShrinkInterval(double subdivisionInterval[3][2], MultiArr<double>* weight);

	
protected:
private:
	int nEquation;
	int* nDegXYZ;
	int nMaxDeg[3];
	int nMaxXYZDeg;
	MultiArr<double>* coeff;
};